# -*- mode: python -*-

from setuptools import setup
block_cipher = None

from pathlib import Path
import os

sep = os.sep


pyParent = os.getcwd()
py_dir = str(Path(pyParent))

exe_name='TLPacker'

main_py = os.path.join(py_dir, 'main.py')
DATA_FILES = []
# version_info = sharedDir+ sep + "file_version_info.txt"

# # 要排除的文件 和 文件夹
# import os
# def removeFile(f_path):
#     if os.path.exists(f_path):
#         try:
#             os.remove(f_path)
#         except IOError:
#             print("没能删除 "+IOError.filename)
# tup=(
#     ".vscode",
#     "__pycache__",
#     "ui\\__pycache__",
#     "vs.转码工具箱.code-workspace",
#     "vs.ff_src.code-workspace",
#     "test.py"
# )
# for f in tup:
#     f = py_dir+"\\"+f
#     removeFile(f)


a = Analysis([main_py],
             pathex=[pyParent],
             binaries=[],
             datas=DATA_FILES,
             hiddenimports=[],
             hookspath=[],
             runtime_hooks=[],
             excludes=[],
             win_no_prefer_redirects=False,
             win_private_assemblies=False,
             cipher=block_cipher,
             noarchive=False)
pyz = PYZ(a.pure, a.zipped_data,
             cipher=block_cipher)
#  onefile
exe = EXE(pyz,
          a.scripts,
          a.binaries,
          a.zipfiles,
          a.datas,
          [],
          name=exe_name,
          debug=False,
          bootloader_ignore_signals=False,
          strip=False,
          upx=True,
        #   version_file=[version_info],
          runtime_tmpdir=None,
          console=True )
